import { GetSingerSongs } from "apis/index";
Page({
  data: {
    id: "", //歌手id
    info: {},
    list: [],
  },

  onLoad(options) {
    const { id } = options;
    this.setData({
      id,
    });
    this.getSongs();
  },

  onShareAppMessage() {},
  //获取歌手单曲
  getSongs() {
    const { id } = this.data;
    GetSingerSongs({ id }).then((res) => {
      console.log(res, "res--singers-------------");
      const { artist, hotSongs } = res;
      artist.aliasStr = artist.alias.join("，");
      this.setData({
        info: artist || {},
        list: hotSongs || [],
      });
    });
  },
});
